import config from "@/config";
import http from "@/utils/request";

export default {
	page: {
		url: `${config.API_URL}/procroutingproduct/pages/`,
		name: "分页",
		get: async function (params) {
			return await http.get(this.url, params);
		},
	},
	pagesbyroutingid: {
		url: `${config.API_URL}/procroutingproduct/pagesbyroutingid/`,
		name: "根据工艺路线查询所有分页",
		get: async function (params) {
			return await http.get(this.url, params);
		},
	},
	pagesproducts: {
		url: `${config.API_URL}/procroutingproduct/pagesproducts/`,
		name: "分隔已绑定的产品制程",
		get: async function (params) {
			return await http.get(this.url, params);
		},
	},
	pageProductByKeyword: {
		url: `${config.API_URL}/procroutingproduct/pagesProductByKeyword`,
		name: "根据产品关键字产线查询",
		get: async function (params) {
			return await http.get(this.url, params);
		},
	},
	list: {
		url: `${config.API_URL}/procroutingproduct/list/`,
		name: "列表",
		get: async function (params) {
			return await http.get(this.url, params);
		},
	},
	model: {
		url: `${config.API_URL}/procroutingproduct/`,
		name: "查询一条",
		get: async function (params) {
			return await http.get(this.url + params);
		},
	},
	add: {
		url: `${config.API_URL}/procroutingproduct/`,
		name: "添加",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	update: {
		url: `${config.API_URL}/procroutingproduct`,
		name: "修改",
		put: async function (data) {
			return await http.put(this.url, data);
		},
	},
	delete: {
		url: `${config.API_URL}/procroutingproduct`,
		name: "删除",
		delete: async function (data) {
			return await http.delete(this.url, data);
		},
	},
};
